import React from 'react';
import {Link} from 'react-router-dom';
import InputElement from '../components/InputElement';
export default class Login extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            username:{
                info:"",
                value:""
            },
            pwd:{
                info:"",
                value:""
            }
          
        }
    }
    handleClick = () => {
        console.log(this.state.username,this.state.pwd)
    }
   
    render(){
        return <div>
            <h1>登录</h1>
            <InputElement type="text"
            onInput={(e) => this.setState({username:{value:e.target.value}})}
            >用户名：</InputElement>
            <InputElement type="password"
            onInput={(e) => this.setState({pwd:{value:e.target.value}})}
            >密码：</InputElement>
           
            <input type="submit" onClick={this.handleClick} />
            <Link to="/reg">注册</Link>
        </div>
    }
}